<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.common.dev.js"></script>
</head>

<body>
    <div id="app">
        <input type="button" value="浪起来" @click="run">
        <input type="button" value="低调" @click="stop">

        <h4>{{msg}}</h4>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: '猥琐发育，别浪~~~',
                interval: null
            },
            methods: {
                run() {
                    console.log(this.msg);

                    if (this.interval != null) return;

                    this.interval = setInterval(() => {
                        var start = this.msg.substring(0, 1); // 获取第一个字符
                        var end = this.msg.substring(1); // 获取第一个字符之后的所有字符
                        this.msg = end + start; // 重新拼接得到新的字符串并赋值
                    }, 400)
                },
                stop() {
                    clearInterval(this.interval);
                }
            }
        })
    </script>
</body>

</html>